import { reactive } from "vue";
export let state = reactive({
  rootTransitionName: "",
});

export const setRootTransitionName = (to, from) => {
  //如果to索引大于from索引,判断为前进状态,反之
  if (to.meta.index > from.meta.index) {
    state.rootTransitionName = "slide-left";
  } else {
    state.rootTransitionName = "slide-right";
  }
};
